n = int(input())
k = 0
if 999<n<10000:
    for i in range(2,n//2):
        if n % i == 0:
            k+=1
        if k == 0:
            print(n)
        else:
            n1 = n%1000
            n2 = n//10
            print(n1,n2)
        if n % i == 0:
            k+=1
        if k == 0:
            print()
            break
        else:
            n3 = n%100
            n4 = n//100
            print(n3,n4)
            break
        if n % i == 0:
            k+=1
        if k == 0:
            print()
        else:
            n5 = n%10
            n6 = n//1000
            print(n5,n6)    
            break
else:
    print('0')
 
